home *** CD-ROM | disk | FTP | other *** search
- Short: 6502 disassembler.
- Author: Bart Trzynadlowski. Amiga port by (Ventzislav Tzvetkov)
- Uploader: drHirudo@Amigascne.org (Ventzislav Tzvetkov)
- Version: 0.1
- Type: dev/cross
-
- ==============================================================================
- 6502d Version 0.1
- Written by Bart Trzynadlowski, 1999
- Amiga Port by Ventzislav Tzvetkov, 2002
- ==============================================================================
-
- Feel free to do whatever you wish with this software, just remember that I
- have provided it "as is" and will not be held responsible for anything that
- occurs as a result of the software.
-
- 6502d is a 6502 disassembler. It does not have any support for special file
- formats, it simply assumes the input file is a raw binary image.
- 6502d uses the following command line to execute:
-
- 6502d -f infile [-s start] [-h] [-v]
-
- The first argument, infile, is the flat binary image you wish to
- disassemble. The start argument is optional and specifies the offset to start
- disassembly at. It is given in hexadecimal. If input occurs past the end of
- the file 6502d displays an endless series of EOF characters. For help on usage
- you can use -h and for the version number you can use -v. If -h or -v are
- encountered on the command line they are processed and the program exits, no
- disassembly occurs. The -v option has higher precedence over -h.
- Standard output is used to print, therefore output can be
- redirected (preferrably to a file) by using > outfile -- where outfile is
- the output file -- at the end of the command line.
- 6502d was compiled on a DOS box with DJ Delorie's DJGPP. The
- command line used was: gcc -o 6502d.exe 6502d.c comline.c disasm.c
-
- A 6502d line of output has the following format:
-
- address opcode instruction [operand,operand]
-
- The address field is the file position. Addresses are implied to be
- hexadecimal numbers. The opcode field is the series of bytes printed in
- hexadecimal which make up the machine instruction. The instruction field is
- the mnemonic name of the given instruction. Operands when they occur are
- printed. With operands a hexadecimal number is specified by the $ prefix and
- an immediate value is specified by the # prefix.
-
- Only documented instructions are supported in this release. Undocumented
- instructions are not recognized and are treated as described below. If demand
- arises I might add undocumented opcodes, but for now I do not need it myself.
- If an opcode is not recognized as a valid 6502 instruction then 6502d simply
- prints .DB $XX where XX is the byte value. If the last 3rd to last byte is not
- an instruction then all 3 of the last bytes in a file are not disassembled,
- instead they are printed as a series of .DBs.
- Displacements in branch instructions are NOT translated into absolute
- addresses. The hexadecimal value of the displacement is printed as is. The
- 6502 can branch 127 bytes up or down the code. The displacement format uses
- one's complement negation to specify wether to jump up or down the code. Bit 7
- alone decided the sign of the byte. Displacements are added/subtracted to the
- address that succeeds the instruction and its operand(s).
- The ability to toggle between printing displacements or absolute
- addresses may be included in future versions of 6502d if any are made. Please
- do not bother me about this issue.
-
- Version history:
- * Version 0.0
- - Initial public release.
- * Version 0.1
- - Now DEC ABS,X displays correctly. (DEC $FFFF,X instead of
- DEC $FFFF)
-
- Enjoy 6502d. The opcode matrix I used (source file opcode.h) is correct to the
- best of my knowledge. The much-less-than-fantastic as6502 assembler aided me
- in testing 6502d.
-
-
-